class Solution(object):
    def pivotArray(self, nums, pivot):
        pre = []
        end = []
        c = []
        for num in nums:
            if num < pivot:
                pre.append(num)
            else:
                if num == pivot:
                    c.append(num)
                else:
                    end.append(num)
        return pre + c + end
